package com.slm.krstartimes.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;

import com.slm.krstartimes.R;
import com.slm.krstartimes.utils.L;

/**
 * Created by dllo on 15/8/19.
 */
public class GuiderActivity extends Activity implements View.OnClickListener {
    private ImageView down_left, down_right, left_right;
    private TextView fling, clickImage;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.detail_guider);
        L.i("第一次启动");
        down_left = (ImageView) findViewById(R.id.down_left);
        down_right = (ImageView) findViewById(R.id.down_right);
        left_right = (ImageView) findViewById(R.id.left_right);
        clickImage = (TextView) findViewById(R.id.clickImage);
        fling = (TextView) findViewById(R.id.fling);
        down_left.setOnClickListener(this);
        down_right.setOnClickListener(this);
        left_right.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        Animation animation = AnimationUtils.loadAnimation(this, R.anim.alpha_a);
        Animation animation1 = AnimationUtils.loadAnimation(this, R.anim.alpha_b);
        switch (view.getId()) {
            case R.id.down_left:
                down_left.setVisibility(View.GONE);
                left_right.setVisibility(View.VISIBLE);
                down_left.setAnimation(animation);
                left_right.setAnimation(animation1);
                clickImage.setVisibility(View.GONE);
                clickImage.setAnimation(animation);
                fling.setVisibility(View.VISIBLE);
                break;

            case R.id.down_right:
                down_right.setVisibility(View.GONE);
                down_left.setVisibility(View.VISIBLE);
                clickImage.setAnimation(animation);
                clickImage.setText("播新闻");
                clickImage.setAnimation(animation1);
                down_right.setAnimation(animation);
                down_left.setAnimation(animation1);

                break;

            case R.id.left_right:
                finish();
                break;
        }
    }
}
